package Servelet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/***
 *@title $NAME
 *@description <TODO description class purpose>
 *@author Tang'ya'kang
 *@VERSION 1.0.0
 *@CREATE 2023/4/27 16:17
 **/
public class Servletform extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        System.out.println(request.getMethod());
        System.out.println(request.getParameter("username"));
        System.out.println(request.getParameter("password"));
        String[] chose=request.getParameterValues("chose");
        for (String it:chose)
            System.out.println(it);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println(request.getMethod());
        System.out.println(request.getParameter("username"));
        System.out.println(request.getParameter("password"));
        String[] chose=request.getParameterValues("chose");
        for (String it:chose)
            System.out.println(it);
    }
}
